import request from '@/assets/request';

export default {
    // 手机验证码登录
    userLogin(data){
        return request.post('/public/user/login',data);
    },
    userLogPwd(data){
        return request.post('/public/user/loginPwd',data);
    },
    editUserPwd(pwd){
        return request.put('/user/editpwd',pwd)
    },
    adminLogin(data){
        return request.post('/public/admin/login',data);
    },
    adminLoginPwd(data){
        return request.post('/public/admin/loginPwd',data);
    },
    editAdminPwd(pwd){
        return request.put('/admin/editpwd',pwd)
    },
    // 获取手机验证码
    getPhoneCode(phone){
        return request.get('/public/getCheckCode',{params:phone});
    },
    // 退出登录
    userLogout(){
        return request.get('/user/logout')
    },
    adminLogout(){
        return request.get('/admin/logout')
    },
    // 获取留言信息的详情
    getFeedbackInfo(id){
        return request.get('/feedback',{params:id});
    },
    // 获取留言信息的分页
    getFeedbackPage(data){
        return request.get('/feedback/page',{params:data});
    },
    // 删除留言信息
    deleteFeedback(id){
        return request.delete('/feedback',{params:id});
    },

    // 获取信息
    getInfo(type){
        return request.get('/info',{params:type});
    },
    // 修改信息
    editInfo(data){
        return request.put('/info',data);
    },


    createMerchant(data){
        return request.post('/merchant',data);
    },
    getMerchantInfo(id){
        return request.get('/merchant',{params:id});
    },
    deleteMerchant(id){
        return request.delete('/merchant',{params:id});
    },
    editMerchant(data){
        return request.put('/merchant',data);
    },
    getMerchantPage(data){
        return request.get('/merchant/page',{params:data})
    },


    getNewsInfo(id){
        return request.get('/news',{params:id});
    },
    getNewsPage(data){
        return request.get('/news/page',{params:data});
    },
    deleteNews(id){
        return request.delete('/news',{params:id});
    },
    editNews(data){
        return request.put('/news',data);
    },
    createNews(data){
        return request.post('/news',data);
    },



    getProductInfo(id){
        return request.get('/product',{params:id});
    },
    getProductPage(data){
        return request.get('/product/page',{params:data});
    },
    getMyProduct(data){
        return request.get('/product/myPage',{params:data});
    },
    createProduct(data){
        return request.post('/product',data);
    },
    editProduct(data){
        return request.put('/product',data);
    },
    deleteProduct(id){
        return request.delete('/product',{params:id});
    },
    listingProduct(id){
        return request.put('/product/listing',id);
    },
    delistingProduct(id){
        return request.put('/product/delisting',id);
    },
    examine(id){
        return request.put('/admin/product/examine',id);
    },
    examineFail(id){
        return request.put('/admin/product/examineFail',id);
    },
    getUser(data){
        return request.get('/admin/getuser',{params:data});
    },
    handleProductOrder(data){
        return request.put('/productOrder/',data);
    },
    getMyProductOrderPage(data){
        return request.get('/productOrder/myPage',{params:data});
    },
    getProductOrderPage(data){
        return request.get('/productOrder/page',{params:data});
    },
    getSale(){
        return request.get('/productOrder/sale');
    },
    editUserInfo(data){
        return request.put('/user',data);
    },
    getUserInfo(id){
        return request.get('/user',{params:id})
    }


}
